// pages/my/my.js
var api = require("../../utils/api.js")
var app = getApp();
Page({

    /**
     * 页面的初始数据
     */
    data: {
        Tpye: 1,
        userInfo: ''
    },
    psyset: function(e) {
        wx.navigateTo({
            url: '../csregistration/csregistration?type=' + e.currentTarget.dataset.type
        })
	}, 
	psytrain(e){
		wx.navigateTo({
			url: '../registerstep/registerstep?step=2' 
		})
	},
    psysets: function(e) {
        wx.navigateTo({
            url: '../consultedit/consultedit?type=' + e.currentTarget.dataset.type
        })
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {
        var that = this
        wx.getStorage({
            key: 'userInfo',
            success(res) {
                let data = { id: res.data.id }
                let url = app.u.HOME_URL + app.u.ME_NEWINFO
                api.requestUrl(data, url).then(res => {
                    that.setData({
                        userInfo: res.data
                    })
                    wx.setStorage({
                        key: 'userInfo',
                        data: res.data
                    })
                })

            },
            fail(res) {

            }
        })
		wx.showShareMenu({
			withShareTicket: true
		}) 
    },


})